<!doctype html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>Bidi Mobile test - Heading</title>

	<script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
	<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, has: { 'dojo-bidi': true }"></script>

	<script type="text/javascript">
		require([
			"dojo/_base/connect",
			"dojo/ready",
			"dojo/_base/array",
			"dojo/dom",
			"dijit/registry",
			"dojox/mobile/Heading",			
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/compat",
			"dojox/mobile/Button",
			"dojox/mobile/ScrollableView",
			"dojox/mobile/TabBar",
			"dojox/mobile/ListItem"
		], function(connect, ready, array, dom, registry, Heading){
			ready(function(){
				var view = registry.byId("view2");
				var demoWidget = new Heading({label:"Programm Heading!", textDir:"rtl", id:"hdn", back:"\u05e9\u05d9\u05de\u05d5\u05e9\u0020\u05d1\u05ea\u05d2\u05d9\u05d5\u05ea back..."});
				view.addChild(demoWidget);	
				//change textDir, text
				var btnLtr = registry.byId("btn5");				
				btnLtr.connect(btnLtr, "onClick", function(){
					registry.byId("h1").set("textDir", "ltr");
				});
				var btnRtl = registry.byId("btn6");
				btnLtr.connect(btnRtl, "onClick", function(){
					registry.byId("h1").set("textDir", "rtl");
				});	
				var btnAuto = registry.byId("btn7");
				btnAuto.connect(btnAuto, "onClick", function(){
					registry.byId("h1").set("textDir", "auto");				
				});						
				var btnLbl = registry.byId("btnLbl");
				btnLbl.connect(btnLbl, "onClick", function(){
					registry.byId("hAuto").set("label", "\u05e9\u05dc\u05d5\u05dd for test!");
					registry.byId("hAuto").set("back", "\u05e9\u05dc\u05d5\u05dd for test!");
					registry.byId("tbAuto").set("label", "\u05e9\u05dc\u05d5\u05dd for test!");
				});				
		});
	
	});
	</script>

	<style>
	html,body {
		height: 100%;
		overflow: hidden;
	}
	hr {
		border: none;
		margin: 0;
	}
	button {
		width: 180px;
		margin: 15px 10px 0;
	}
	button.customButton {
		border-color: #cc3333;
		background-image: url('../images/red-button-bg.png');
		background-image: -webkit-gradient(linear, left top, left bottom, from(#D3656D), to(#BC1320), color-stop(0.5, #C9404B), color-stop(0.5, #BC1421));
		color: #ffffff;
	}
	</style>
</head>
<body style="visibility:hidden;">
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'><!-- keepScrollPos=false is to improve performance -->
	<div id="view0" data-dojo-type="dojox.mobile.ScrollableView">
	 <h2 data-dojo-type="dojox.mobile.Heading">Heading widget</h2>
		<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1>	
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li>
			<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li>
			<li id="l3" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li>
		</ul>
		<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1>
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l4" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li>
			<li id="l5" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li>
			<li id="l6" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li>
		</ul>	
	</div>	
	<div id="view1" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>textDir LTR</h1>
		<div data-dojo-type="dojox.mobile.Heading" id="h1" data-dojo-props='textDir:"ltr", label:"Hello World!", back:"Hello World!" '>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"ltr", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"ltr",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"ltr", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
		<hr>
		<button data-dojo-type="dojox.mobile.Button" id="btn5" class="mblRedButton" data-dojo-props='label:"Set textDir ltr"'></button>
		<button data-dojo-type="dojox.mobile.Button" id="btn6" class="mblRedButton" data-dojo-props='label:"Set textDir rtl"'></button>
		<button data-dojo-type="dojox.mobile.Button" id="btn7" class="mblRedButton" data-dojo-props='label:"Set textDir auto"'></button>	
		<hr>
		<div data-dojo-type="dojox.mobile.Heading" data-dojo-props='textDir:"ltr", label:"RTL text Dir in ToolBarButton"'>
			<span data-dojo-type="dojox.mobile.ToolBarButton" defaultColor="mblColorBlue" data-dojo-props='icon:"mblDomButtonWhitePlus",textDir:"rtl", label:"Hello &#1506;&#1493;&#1500;&#1501;!"' style="width:120px"></span>
		</div><br>
		
	</div>	
	<div id="view2" data-dojo-type="dojox.mobile.ScrollableView">
			<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>textDir RTL</h1>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"rtl", label:"Hello World!", back:"Hello World!" '>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"rtl", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"rtl",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"rtl", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
		<hr>
		<h1 data-dojo-type="dojox.mobile.Heading">Programmatically created</h1>
	
	</div>	
	<div id="view3" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>textDir AUTO</h1>
		<div data-dojo-type="dojox.mobile.Heading" id="hAuto" data-dojo-props='textDir:"auto", label:"Hello World!", back:"Hello World!" '>
			<span id="tbAuto" data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"auto", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"auto",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"auto", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
		<hr>		
		<button data-dojo-type="dojox.mobile.Button" id="btnLbl" >Set new text</button>		
		
	</div>	
	 
	<div dir="rtl" id="view4" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>dir RTL, textDir LTR</h1>
		<hr>
		<div data-dojo-type="dojox.mobile.Heading" id="h11" data-dojo-props='textDir:"ltr", label:"Hello World!", back:"Hello World!" '>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"ltr", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"ltr",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"ltr", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
		

		<div data-dojo-type="dojox.mobile.Heading" data-dojo-props='textDir:"ltr", label:"RTL text Dir in ToolBarButton"'>
			<span data-dojo-type="dojox.mobile.ToolBarButton" defaultColor="mblColorBlue" data-dojo-props='icon:"mblDomButtonWhitePlus",textDir:"rtl", label:"Hello &#1506;&#1493;&#1500;&#1501;!"' style="width:120px"></span>
		</div><br>
	</div>
	<div dir="rtl" id="view5" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>dir RTL, textDirRTR</h1>
		<hr>		
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"rtl", label:"Hello World!", back:"Hello World!" '>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"rtl", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"rtl",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"rtl", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
	</div>	
	<div dir="rtl" id="view6" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>dir RTL, textDir AUTO</h1>
		<hr>	
		<div data-dojo-type="dojox.mobile.Heading" id="hAuto1" data-dojo-props='textDir:"auto", label:"Hello World!", back:"Hello World!" '>
			<span id="tbAuto1" data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue"  >Hello World!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >Hello &#1506;&#1493;&#1500;&#1501;!</span>
			<span data-dojo-type="dojox.mobile.ToolBarButton"   defaultColor="mblColorBlue" >&#1513;&#1500;&#1493;&#1501; World!</span>
		</div><br>

		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"auto", back:"&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!"'>&#1513;&#1500;&#1493;&#1501; &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props='textDir:"auto",  back:"Hello &#1506;&#1493;&#1500;&#1501;!"'>Hello &#1506;&#1493;&#1500;&#1501;!
		</div><br>
		<div data-dojo-type="dojox.mobile.Heading"  data-dojo-props=' textDir:"auto", back:"&#1513;&#1500;&#1493;&#1501; World!"'>&#1513;&#1500;&#1493;&#1501; World!
		</div><br>
	</div>	
</div>

</div>
</body>
</html>
